import request from '@/utils/request'

export const goodsListApi = (query) => {
    return request({
        url: '/goods/list',
        method: 'get',
        params: query
    })
}

export const detailByID = (id) => {
    return request({
        url: `/goods/${id}`,
        method: 'get',
    })
}

//修改或添加goods
export const goodsAddAndUpdate = data => {
    return request({
        url: '/goods/post',
        method: 'post',
        data
    })
}

//删除商品
export const goodsDeleteApi = id => {
    return request({
        url: `/goods/${id}`,
        method: 'delete',
    })
}
//查询点赞和浏览次数
export const liekAndViewApi = goods_id => {
    return request({
        url: '/goods/liekAndViewCount',
        method: 'get',
        params: {goods_id}
    })
}

